package org.nbict.iot.task.once;

import org.bson.Document;

/**
 * Created by songseven on 18/6/23.
 */
public class TimeSpan {

//    private Pointer start; //起始点
//    private Pointer end;  //结束点
    private Long from;
    private Long to;

    private Long fromlon;
    private Long fromlat;

    private Long tolon;
    private Long tolat;

    private Integer soc;

    private String vin;

    private String status;

    public TimeSpan(String vin, Long from, Long to, Long fromlon, Long fromlat, Long tolon, Long tolat,
                    Integer soc, String status) {
        this.from = from;
        this.to = to;
        this.vin = vin;
        this.fromlon = fromlon;
        this.fromlat = fromlat;
        this.tolon = tolon;
        this.tolat = tolat;
        this.soc = soc;
        this.status = status;
    }

    public String getVin() {
        return vin;
    }

    public TimeSpan setVin(String vin) {
        this.vin = vin;
        return this;
    }

    public Long getFrom() {
        return from;
    }

    public TimeSpan setFrom(Long from) {
        this.from = from;
        return this;
    }

    public Long getTo() {
        return to;
    }

    public TimeSpan setTo(Long to) {
        this.to = to;
        return this;
    }

    public Long getFromlon() {
        return fromlon;
    }

    public TimeSpan setFromlon(Long fromlon) {
        this.fromlon = fromlon;
        return this;
    }

    public Long getFromlat() {
        return fromlat;
    }

    public TimeSpan setFromlat(Long fromlat) {
        this.fromlat = fromlat;
        return this;
    }

    public Long getTolon() {
        return tolon;
    }

    public TimeSpan setTolon(Long tolon) {
        this.tolon = tolon;
        return this;
    }

    public Long getTolat() {
        return tolat;
    }

    public TimeSpan setTolat(Long tolat) {
        this.tolat = tolat;
        return this;
    }

    public Integer getSoc() {
        return soc;
    }

    public TimeSpan setSoc(Integer soc) {
        this.soc = soc;
        return this;
    }

    public String getStatus() {
        return status;
    }

    public TimeSpan setStatus(String status) {
        this.status = status;
        return this;
    }

    public Document toDocument() {
        Document doc = new Document();
        doc.append("car_vin", vin);
        doc.append("from", from);
        doc.append("to", to);
        doc.append("soc", soc);
        doc.append("fromlon", fromlon);
        doc.append("fromlat", fromlat);
        doc.append("tolon", tolon);
        doc.append("tolat", tolat);
        doc.append("status", status);
        return doc;
    }

    @Override
    public String toString() {
        return "car_vin: " + vin + " from: " + from + " to: " + to;
    }
}
